﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MINERP.ComControls.Extension;

using MINERP.BLL.Statistics;

namespace MINERP.Statistics.Forms
{
    public partial class FrmBillEditRecord : Form
    {
        private static FrmBillEditRecord _instance = null;
        private ShopBillIndexBLL _bll = new ShopBillIndexBLL();
        
        private FrmBillEditRecord()
        {
            InitializeComponent();
            gvBillEditRecords.ShowRowIndicator(50);
        }

        public static FrmBillEditRecord Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = new FrmBillEditRecord();
                }
                return _instance;
            }

        }
        private void FrmBillEditRecord_Load(object sender, EventArgs e)
        {

        }

        private void FrmBillEditRecord_FormClosing(object sender, FormClosingEventArgs e)
        {
            _instance = null;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            DateTime start = dtStartTime.DateTime.Date;
            DateTime end = dtEndTime.DateTime.AddDays(1).Date.AddSeconds(-1);
            gcBillEditRecords.DataSource = _bll.GetBillEditRecords(start,end);
            gcBillEditRecords.RefreshDataSource();
        }
    }
}
